<template>
	<div class="addstaff">
		<div class="header">
			<div class="go">
				<i class="el-icon-erp-shangyiye" @click="back"></i>
				<p>二维码</p>
			</div>
		</div>
		<div class="body">
		   <img :src="url">
		   <p>扫一扫上面的二维码图片，成为员工</p>
		</div>
	</div>
</template>

<script>
export default {
	name:'addstaff',
	data () {
		return {
			url:''
		}
	},
	created () {
		this.getCode()
	},
	methods:{
	  //获取扫描二维码
	  getCode () {
	  	this.$http.get(this.$store.state.reqUrl + '/shop/emps/empQrCode/'+this.$store.state.shop_id, {}).then(res => {
			   	  this.url = res.data;
		    })	
	  },
	  back () {
	  	this.$router.go(-1)
	  }
	}
}
</script>

<style lang="less" scoped>
  .addstaff{
  	    width: 100%;
		height: 100%;
		top:0;
		left:0;
		position:fixed;
		z-index: 888;
		background:rgba(0,0,0,0.8);
  	.header{
    		width:100%;
    		z-index: 44;
    		color:#FFFFFF;
    		.go{
    			display: flex;
    			width:100%;
    			height: 100px;
    			i{   
    				width:80px;
    				font-size: 34px;
    				text-align: center;
    				line-height: 100px;   				
    			}
    			p{
    				flex: 1;
    				font-size: 34px;
    				line-height: 100px;
    			}
    		}
    	} 
  	   .body{
  	   	  position: relative;
  	   	  width:80%;
  	   	  height: 60%;
  	   	  background: #FFFFFF;
  	   	  margin:0 auto;
  	   	  margin-top: 100px;
  	   	  img{
  	   	  	width:80%;
  	   	  	height: 60%;
  	   	  	margin:0 auto;
  	   	  	padding:20% 0;
  	   	  }
  	   	  p{
  	   	  	width:100%;
  	   	  	position: absolute;
  	   	  	font-size: 28px;
  	   	  	color: gray;
  	   	  	bottom:30px;
  	   	  	left: 50%;
  	   	  	margin-left: -36%;
  	   	  }
  	   }
  }
</style>